//
//  YWTableView.m
//  YueshengToutiao
//
//  Created by yellow on 2021/4/16.
//  Copyright © 2021 YW. All rights reserved.
//

#import "YWTableView.h"

@implementation YWTableView

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        [self setupTableView];
    }
    return self;
}

-(void)awakeFromNib{
    [super awakeFromNib];
    [self setupTableView];
}

-(void)setupTableView{
    
    //写了这句话就不会露出上拉控件，所以以后每个tableView都要写
        if (@available(iOS 11.0, *)) {
            
            self.estimatedRowHeight = 0;
            
            self.estimatedSectionFooterHeight = 0;
            
            self.estimatedSectionHeaderHeight=0;
            self.contentInsetAdjustmentBehavior= UIScrollViewContentInsetAdjustmentNever;
            
        }
        
    self.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    if (self.style == UITableViewStyleGrouped) {
        
        self.tableFooterView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, Wi, 0.01)];
        self.tableHeaderView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, Wi, 0.01)];
        self.sectionFooterHeight = 0;
        self.sectionHeaderHeight = 0;
    }
    else{
        
        self.tableFooterView = [[UIView alloc]init];
    }
    
    self.showsVerticalScrollIndicator = NO;
    self.contentInset = UIEdgeInsetsMake(0, 0, UIApplication.sharedApplication.keyWindow.jx_layoutInsets.bottom, 0);
}

@end
